package com.mazha.rabbitmq.base;

import com.mazha.rabbitmq.pojo.vo.ChatMessageVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;



/**
 * 公用聊天消息体
 *
 * @author leizi
 * @date 2023/12/09
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MqMessage {
    /**
     * 协议：群id
     */
    private String method;
    /**
     * 屏蔽用户，用户不接收消息
     */
    private Long shieldMethod;
    /**
     * 消息内容
     */
    private Object data;

    public MqMessage(ChatMessageVO chatMessageVO) {
        this.method = chatMessageVO.getGroupId();
        this.shieldMethod = chatMessageVO.getInitiateUserId();
        this.data = chatMessageVO.getMessage();
    }
}
